home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Textdisplayers / JMore / Source / openlib.c < prev    next >
C/C++ Source or Header  |  1996-09-26  |  1KB  |  54 lines

  1. /*
  2.  *    openlib.c
  3.  *    H.Ohkubo Aug. 4 1992
  4.  */
  5.  
  6. #include    <exec/types.h>
  7. #include    <intuition/intuitionbase.h>
  8. #include    <graphics/gfxbase.h>
  9. #include    <functions.h>
  10. #include    <stdio.h>
  11. #include    <stdlib.h>
  12. #include    "openlib.h"
  13.  
  14. #define    INTUITION_LIB    "intuition.library"
  15. #define    GRAPHICS_LIB    "graphics.library"
  16. #define    DISKFONT_LIB    "diskfont.library"
  17.  
  18. #define    INTUITION_REV    33L
  19. #define    GRAPHICS_REV    33L
  20. #define    DISKFONT_REV    33L
  21.  
  22. struct    IntuitionBase    *IntuitionBase = NULL;
  23. struct    GfxBase    *GfxBase = NULL;
  24. struct    Library    *DiskfontBase = NULL;
  25.  
  26. BOOL    OpenLib(VOID)
  27. {
  28.     BOOL    retval = FALSE;
  29.  
  30.     if ((IntuitionBase = (struct IntuitionBase *)
  31.         OpenLibrary(INTUITION_LIB, INTUITION_REV)) != NULL) {
  32.         if ((GfxBase = (struct GfxBase *)
  33.             OpenLibrary(GRAPHICS_LIB, GRAPHICS_REV)) != NULL) {
  34.             if ((DiskfontBase =
  35.                 OpenLibrary(DISKFONT_LIB, DISKFONT_REV)) != NULL) {
  36.                 retval = TRUE;
  37.             }
  38.             else
  39.                 CloseLib();
  40.         }
  41.         else
  42.             CloseLib();
  43.     }
  44.     return retval;
  45. }
  46.  
  47. VOID    CloseLib(VOID)
  48. {
  49.     if (GfxBase)
  50.         CloseLibrary(GfxBase);
  51.     if (IntuitionBase)
  52.         CloseLibrary(IntuitionBase);
  53. }
  54.